#ifndef __WEBWIDGET_H
#define __WEBWIDGET_H

#include <gtkmm.h>
#include <webkit/webkit.h>
#include <JavaScriptCore/JavaScript.h>
#include <boost/regex.hpp>
#include <string>
#include <iostream>
#include <curl/curl.h>

struct Capability
{
    Capability(std::string cap, std::string title, std::string href): cap(cap), title(title), href(href) {}
    std::string cap;
    std::string title;
    std::string href;
};

class WebWidget
{
    public:
        void script(std::string script);
        void addCapability(std::string cap, std::string title, std::string href);
        std::string open(std::string uri);
        std::string html(std::string html);
        std::string getName();
        std::string getTitle();
        std::string getURI();
        std::string listCapabilities();
        Gtk::Widget* getWidget();
        JSContextRef getJavascriptContext();
        WebKitWebView* getWebView();
        void notifyCapabilities();
        void resetCapabilities();
        void hookConsoleFunctions();
        //WebWidget(std::string uri);
        WebWidget();
        void navigationRequested(WebKitWebView* thisWebView, WebKitWebFrame* thisWebFrame, WebKitNetworkRequest* thisnetrequest);
    private:
        Gtk::Widget *gtkwidget;
        WebKitWebView* webView;
        std::vector<Capability> feeds;
        std::vector<Capability> searches;

};

#endif
